<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>XmlToJson</title>
    <script src="../lib/jquery/jquery-1.10.2.js"></script>
    <script src="../lib/angularjs/angular.js"></script>
    <script src="../lib/xml2json.js"></script>
</head>
<body>
<div ng-app="httpApp" ng-controller="httpController">
    <h2>这个需要nodejs</h2>
</div>
</body>
<script>
    var app = angular.module('httpApp', []);
    app.controller('httpController', function ($scope, $http) {
        $http.get("data.xml.xml",
            {
                transformResponse: function (cnv) {
                    var x2js = new X2JS();
                    var aftCnv = x2js.xml_str2json(cnv);
                    return aftCnv;
                }
            })
            .success(function (response) {
                console.log(response);
            });
    });
</script>
</html>